<?php

require_once 'core/abstract.db.php';

class game extends db {

	public function controllUserSession() {
		if( ! empty($_SESSION['cid']) && ! empty($_SESSION['aid']))
		{
			return TRUE;
		} else {
			header('location: index.php');
		}
	}
	
	public function checkMessage()
	{
		$this -> open();
		$rd = $this -> query("SELECT COUNT(mail_id) AS num_mail FROM mail WHERE mail_to = " . $_SESSION['aid'] . " AND mail_read = 0") -> fetch();
		
		return $rd;
	}

}

?>